package com.hdd.demo.dao;


import com.hdd.demo.entity.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface UserDao {


    @Select("select * from user")
    List<User> getAll();

    @Insert("insert user (username,password) values(#{username},#{password})")
    void add(User user);


    @Delete("delete from user where id =#{id}")
    void delete(Integer id);

    @Select("select * from user where id = #{id}")
    User get(int id);

    @Update("update user set username=#{username},password=#{password} where id=#{id}")
    void update(User user);
}
